package com.breadenglish.cms.api.app.dao.impl;

import com.breadenglish.cms.api.app.dao.CityDao;
import com.breadenglish.cms.api.app.domain.db.City;
import com.breadenglish.cms.api.app.mapper.CityMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * City
 * <p/>
 * User: guoyao
 * DateTime: 2013-12-16 17:26:44
 */
@Service("cityDao")
public class CityDaoImpl implements CityDao {

    @Resource
    private CityMapper cityMapper;

    /**
     * 根据主键查询City对象
     *
     * @param cityId
     * @return City对象
     */
    @Override
    public City selectByPrimaryKey(String cityId) {
        return cityMapper.selectByPrimaryKey(cityId);
    }

    /**
     * 根据查询条件查询符合条件的City对象
     *
     * @param city
     * @return 符合条件的City对象List
     */
    @Override
    public List<City> select(City city) {
        return cityMapper.select(city);
    }

    /**
     * 根据主键删除City对象
     *
     * @param cityId
     * @return 影响条件数
     */
    @Override
    public int deleteByPrimaryKey(String cityId) {
        return cityMapper.deleteByPrimaryKey(cityId);
    }

    /**
     * 根据条件删除符合条件的City对象
     *
     * @param city
     * @return 影响条件数
     */
    @Override
    public int delete(City city) {
        return cityMapper.delete(city);
    }

    /**
     * 插入City对象
     *
     * @param city
     * @return 影响条件数
     */
    @Override
    public int insert(City city) {
        return cityMapper.insert(city);
    }

    /**
     * 更新City对象
     *
     * @param city
     * @return 影响条件数
     */
    @Override
    public int update(City city) {
        return cityMapper.update(city);
    }

    @Override
    public City selectByCityName(String cityName) {
        return cityMapper.selectByCityName(cityName);
    }
}
